<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
 * Piece Template tags that can go anywhere in a template.
 * @packpage	Arlicle
 * @author 		Edison Rao
 * @copyright 	(c) 2009 Arlicle Team
 * @license 	GNU General Public License 2.0
 */
class PieceTag_Core {
    public static $pieces = array();

    public static function content($tag) {
        if (empty(self::$pieces[$tag])) {
            self::$pieces[$tag] = ORM::factory('post')->where(array('uri'=>$tag, 'diagram_id'=>0, 'status'=>0))->find();
        }
        return self::$pieces[$tag]->content;
    }

    public static function title($tag) {
        if (empty(self::$pieces[$tag])) {
            self::$pieces[$tag] = ORM::factory('post')->where(array('uri'=>$tag, 'diagram_id'=>0, 'status'=>0))->find();
        }
        return self::$pieces[$tag]->title;
    }
}
